import Vue from 'vue'
import App from './App.vue'
import "./style/reset.less"
// 6、引入封装的路由对象
import router from "./router/index.js"

Vue.config.productionTip = false
// vant组件库的全局引入注册
import { Search,Grid, GridItem,List,PullRefresh, Tab, Tabs,Dialog,Uploader,Icon,NavBar,Cell, CellGroup,Button,Form,Field,Toast } from 'vant';
Vue.use(Button);
Vue.use(Form);
Vue.use(Field);
Vue.use(Toast);
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(NavBar);
Vue.use(Icon);
Vue.use(Uploader);
Vue.use(Dialog);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(PullRefresh);
Vue.use(List);
Vue.use(Grid);
Vue.use(GridItem);
Vue.use(Search);

// 注册全局组件
import newsItem from "./components/newsItem.vue"
Vue.component("newsItem", newsItem)
import comment from "./components/comment.vue"
Vue.component("commentFooter", comment)

// 声明全局过滤器，用来拼接图片基础路径
import axios from "./utils/request"
Vue.filter("joinPath", function(val){
  return axios.defaults.baseURL+val
})

new Vue({
  // 7、把路由对象注入到vue实例中
  router,
  render: h => h(App),
}).$mount('#app')
